/* 
 * File:   JOperation.cpp
 * Author: johnneyshi
 * 
 * Created on 2013年1月7日, 下午1:30
 */

#include "JOperation.h"

JOperation::JOperation() {
}

JOperation::JOperation(const JOperation& orig) {
}

JOperation::~JOperation() {
}

int JOperation::Serialize(std::iostream& _strea,int& allSize)
{
//    //Serialize begin.
//    std::string className;
//    std::string methodName;
//    std::list<JArgsBase*> listArgs;
//    //Serialize end.
    int classSize = 0,selfSize = 0;
    JSerialize::PutInt(_strea,classSize,selfSize);
    JSerialize::Serialize(_strea,this->className,classSize);
    JSerialize::Serialize(_strea,this->methodName,classSize);
    JSerialize::Serialize<JArgsBase>(_strea,this->listArgs,classSize);
    selfSize += classSize;
    JSerialize::Verify(_strea,classSize,-1*selfSize);
    allSize += selfSize;
    return selfSize;
}

void JOperation::ReSerialize(std::iostream& _strea)
{
    int classSize = JSerialize::GetInt(_strea,sizeof(int));
    this->className = JSerialize::ReSerializeString(_strea);
    this->methodName = JSerialize::ReSerializeString(_strea);
    this->listArgs = JSerialize::ReSerializeList<JArgsBase>(_strea);
}
